<?php
/**
Laravel 8中必须要先引用使用到的控制器比如要调用到UserController必须先引入use App\Http\Controllers\UserController;
或者在定义路由时加上控制器的命名空间，
如果仍然想使用Laravel 6/7版本的路由配置方式，那么取消RouteServiceProvider.php中对$namespace的注释即可。
// protected $namespace = 'App\\Http\\Controllers';//取消对这句代码的注释。

*/
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    //return view('welcome');
    return 'helloworld';
});
Route::get('/user', [UserController::class, 'index']);
Route::get('/user/delete', [UserController::class, 'delete']);
Route::get('/user/update', [UserController::class, 'update']);
Route::get('/user/add', [UserController::class, 'add']);
//Route::get('/user', 'UserController@index');